package fun.ty13.controller;

import fun.ty13.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 桃缘十三
 * @date 2022/11/25 16:01
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Value("${server.port}")
    private String port;
    @GetMapping("/{id}")
    public User get(@PathVariable Long id) {
        //System.out.println(1/0);
        return new User(id, "十三"+port);
    }
}
